import requests

#https://cn.bing.com/search?q=%E8%B0%B7%E6%AD%8C%E7%BF%BB%E8%AF%91
#UA伪装
headers = {
    'User-Agent':"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36"
}
url="https://zzk.cnblogs.com/s/blogpost"
url='https://cn.bing.com/search'
kw=input("输入一个关键词:")
param= {
    'q': kw
}
respones=requests.get(url=url,params=param,headers=headers)

page_text = respones.text
print(page_text)
# step 4 持久化存储
with open('./wuyuan.html', "w", encoding="utf-8") as fp:
    fp.write(page_text)
print("爬取数据结束!")

